package edu.uts.reekie.designer.edit;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;

import edu.uts.reekie.designer.figures.FigureFactory;
import edu.uts.reekie.designer.model.*;

public abstract class EditPartFactoryBase implements EditPartFactory {
	
	protected  abstract FigureFactory createFigureFactory();
	protected  abstract ModelFactory createModelFactory();

	public EditPart createEditPart(EditPart context, Object model) {
		EditPart ep = null;
		FigureFactory ff = createFigureFactory();
		ModelFactory mf = createModelFactory();
		
		// work out what the model is
		if (model instanceof Note)
			ep = new NoteEditPart(mf,ff);
		
		
		
		if (ep!=null) {
			ep.setModel(model);
		}
		return ep;
	}
}
